package com.jay.relationships.mediator;

public class HealthTask {
    private HealthRecord record;
    private String taskName;
    private Integer initialHealPoint;

    public HealthTask(HealthRecord record, String taskName, Integer initialHealPoint) {
        this.record = record;
        this.taskName = taskName;
        this.initialHealPoint = initialHealPoint;
    }

    public Integer calculateHealthPointForTask(){
        //计算该任务所能获取的积分，需要健康等级信息。健康登记越低积分越高，以鼓励用户多做任务
        Integer healthPointFromHealthLevel = 12 / record.getHealthLevel();
        //最终积分为初始积分 + 与健康等级相关的几人
        return initialHealPoint + healthPointFromHealthLevel;
    }

    public HealthRecord getRecord() {
        return record;
    }

    public void setRecord(HealthRecord record) {
        this.record = record;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public Integer getInitialHealPoint() {
        return initialHealPoint;
    }

    public void setInitialHealPoint(Integer initialHealPoint) {
        this.initialHealPoint = initialHealPoint;
    }
}
